import { request } from 'umi';

// 添加分类
export function getCategory(id: string, label: string, value: string) {
  return request(`/api/category/${id}`, {
    method: 'PATCH',
    data: { label, value },
  });
}
// 新增分类
export function putCategory(label: string, value: string) {
  return request(`/api/category`, {
    method: 'POST',
    data: { label, value },
  });
}
// 删除分类
export function delCategory(id: string) {
  return request(`/api/category/${id}`, {
    method: 'DELETE',
  });
}
